package com.water.mathcollections.sort;

import java.util.HashMap;
import java.util.Map;

public class NodeSolve implements NodeEntry {

    private Node node;
    @Override
    public Node insert(Node node,int value) {
        if (node == null) {
            node = new Node(value);
        }
        int cmp = value - node.value;
        if (cmp > 0) {
            node.right = insert(node.right, value);
        } else if (cmp < 0) {
            node.left = insert(node.left, value);
        } else {
            node.value = value;
        }
        this.node = node;
        return node;

    }

    @Override
    public void remove(Node oldNode) {
        Map<String,Object> map = new HashMap<>();
        map.put("","");

    }

    @Override
    public Node get(String value) {
        return node;
    }
    public Node get() {
        return node;
    }

    public static void main(String[] args) {
        int h;
        String key="asassa";
        String key1="asassa1";
        String key2="asassa2";
        String key3="asassa3";
        int hashCode = (key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);
        int hashCode1 = (key1 == null) ? 0 : (h = key1.hashCode()) ^ (h >>> 16);
        int hashCode2 = (key2 == null) ? 0 : (h = key2.hashCode()) ^ (h >>> 16);
        int hashCode3 = (key3 == null) ? 0 : (h = key3.hashCode()) ^ (h >>> 16);
        System.out.println(hashCode);
        System.out.println(hashCode1);
        System.out.println(hashCode2);
        System.out.println(hashCode3);

    }
}
